"""首页选择商品  进行加购 批采"""
import time

import allure
import pytest
from base.WebKeys import WebKeys
from page.home_purchase_pc_page.home_purchase_pc_dict import get_mall_xpath

class MallFlow_home_purchase_pc(WebKeys):

    def xl_Increase_the_purchase_of_goods(self):
        """到首页加购 一个批采商品"""
        with allure.step("鼠标滑动到商品"):
            self.slide_element(get_mall_xpath("xl_element"))

        with allure.step("点击商品 进入商品详情"):
            self.wait_click(get_mall_xpath("xl_element"))

        with allure.step("切换到最新的窗口"):
            self.change_window(-1)

        with allure.step("切换到批量采集"):
            self.is_element_present(get_mall_xpath("Toggle"),10)

        with allure.step("加入购物车"):
            time.sleep(1)
            self.is_element_present(get_mall_xpath("Add_to_cart"),10)



    # def get_result_true(self):
    #     """断言加入购物车成功提示语"""
    #     Assertion = '//*[@id="ant-message"]/span/div/div'
    #     result=self.read(Assertion)
    #     return result


